﻿using Newtonsoft.Json;
using PCL.WP8.Common.Domain;
using System;
using System.Collections.Generic;
using System.Linq;
using System.Net.Http;
using System.Runtime.Serialization.Json;
using System.Text;
using System.Threading.Tasks;

namespace PCL.WP8.Demo
{
    public class ParticipanteProxy
    {
        public async Task<IEnumerable<Participante>> Get()
        {
            HttpClient client = new HttpClient();
            var json = await client.GetAsync(new Uri("http://wawp8demo.azurewebsites.net/api/participantes", UriKind.Absolute));
            var jsonString = await json.Content.ReadAsStringAsync();
            return JsonConvert.DeserializeObject<IEnumerable<Participante>>(jsonString);
        }
    }
}
